﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    public class SqlHelper
    {
        private static readonly string connectionString= "server=. ;database=leetcode;uid=sa;pwd=123456";

        public static SqlDataReader SqlOperate(string cmdString)
        {
            SqlConnection sqlConnection = new SqlConnection(connectionString);

            using (SqlCommand sqlCommand = new SqlCommand(cmdString, sqlConnection))
            {
                
                sqlConnection.Open();

                return sqlCommand.ExecuteReader();
            } 
        }
    }
}
